package main

import "fmt"

/**
  channel是引用类型
 */
func main() {
	c := make(chan bool)
	go func() {
		fmt.Println("go running")
		c<-true
		close(c)    //最后关闭通道
	}()

	for v := range c {
		fmt.Println(v)
	}
}